﻿using System.Data.SqlClient;

namespace EOffice.Common
{    
		
    public class DTOParserFeedBack : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdTitle;
		
		public int OrdContent;
		
		public int OrdUserId;
		
		public int OrdCreatedDate;
		
		public int OrdStatus;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdTitle = reader.GetOrdinal("Title");
	        	
	    	OrdContent = reader.GetOrdinal("Content");
	        	
	    	OrdUserId = reader.GetOrdinal("UserId");
	        	
	    	OrdCreatedDate = reader.GetOrdinal("CreatedDate");
	        	
	    	OrdStatus = reader.GetOrdinal("Status");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			FeedBackDto feedBack = new FeedBackDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { feedBack.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdTitle)) { feedBack.Title = reader.GetString(OrdTitle); }
	        	
	    	if (!reader.IsDBNull(OrdContent)) { feedBack.Content = reader.GetString(OrdContent); }
	        	
	    	if (!reader.IsDBNull(OrdUserId)) { feedBack.UserId = reader.GetInt32(OrdUserId); }
	        	
	    	if (!reader.IsDBNull(OrdCreatedDate)) { feedBack.CreatedDate = reader.GetDateTime(OrdCreatedDate); }
	        	
	    	if (!reader.IsDBNull(OrdStatus)) { feedBack.Status = reader.GetString(OrdStatus); }
	        			
			feedBack.IsNew = false;
			
			return feedBack;
		}
	}
	
		
    public class DTOParserFile : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdDisplayName;
		
		public int OrdName;
		
		public int OrdExtension;
		
		public int OrdCreatedDate;
		
		public int OrdUserId;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdDisplayName = reader.GetOrdinal("DisplayName");
	        	
	    	OrdName = reader.GetOrdinal("Name");
	        	
	    	OrdExtension = reader.GetOrdinal("Extension");
	        	
	    	OrdCreatedDate = reader.GetOrdinal("CreatedDate");
	        	
	    	OrdUserId = reader.GetOrdinal("UserId");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			FileDto file = new FileDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { file.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdDisplayName)) { file.DisplayName = reader.GetString(OrdDisplayName); }
	        	
	    	if (!reader.IsDBNull(OrdName)) { file.Name = reader.GetString(OrdName); }
	        	
	    	if (!reader.IsDBNull(OrdExtension)) { file.Extension = reader.GetString(OrdExtension); }
	        	
	    	if (!reader.IsDBNull(OrdCreatedDate)) { file.CreatedDate = reader.GetDateTime(OrdCreatedDate); }
	        	
	    	if (!reader.IsDBNull(OrdUserId)) { file.UserId = reader.GetInt32(OrdUserId); }
	        			
			file.IsNew = false;
			
			return file;
		}
	}
	
		
    public class DTOParserFileFolder : DTOParser
    {			
		
		public int OrdFolderId;
		
		public int OrdFileId;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdFolderId = reader.GetOrdinal("FolderId");
	        	
	    	OrdFileId = reader.GetOrdinal("FileId");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			FileFolderDto fileFolder = new FileFolderDto();
			
				
	    	if (!reader.IsDBNull(OrdFolderId)) { fileFolder.FolderId = reader.GetInt32(OrdFolderId); }
	        	
	    	if (!reader.IsDBNull(OrdFileId)) { fileFolder.FileId = reader.GetInt32(OrdFileId); }
	        			
			fileFolder.IsNew = false;
			
			return fileFolder;
		}
	}
	
		
    public class DTOParserFolder : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdName;
		
		public int OrdUserId;
		
		public int OrdParentId;
		
		public int OrdCreatedDate;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdName = reader.GetOrdinal("Name");
	        	
	    	OrdUserId = reader.GetOrdinal("UserId");
	        	
	    	OrdParentId = reader.GetOrdinal("ParentId");
	        	
	    	OrdCreatedDate = reader.GetOrdinal("CreatedDate");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			FolderDto folder = new FolderDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { folder.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdName)) { folder.Name = reader.GetString(OrdName); }
	        	
	    	if (!reader.IsDBNull(OrdUserId)) { folder.UserId = reader.GetInt32(OrdUserId); }
	        	
	    	if (!reader.IsDBNull(OrdParentId)) { folder.ParentId = reader.GetInt32(OrdParentId); }
	        	
	    	if (!reader.IsDBNull(OrdCreatedDate)) { folder.CreatedDate = reader.GetDateTime(OrdCreatedDate); }
	        			
			folder.IsNew = false;
			
			return folder;
		}
	}
	
		
    public class DTOParserGroupUser : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdName;
		
		public int OrdDescription;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdName = reader.GetOrdinal("Name");
	        	
	    	OrdDescription = reader.GetOrdinal("Description");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			GroupUserDto groupUser = new GroupUserDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { groupUser.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdName)) { groupUser.Name = reader.GetString(OrdName); }
	        	
	    	if (!reader.IsDBNull(OrdDescription)) { groupUser.Description = reader.GetString(OrdDescription); }
	        			
			groupUser.IsNew = false;
			
			return groupUser;
		}
	}
	
		
    public class DTOParserHoliday : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdUserId;
		
		public int OrdDate;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdUserId = reader.GetOrdinal("UserId");
	        	
	    	OrdDate = reader.GetOrdinal("Date");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			HolidayDto holiday = new HolidayDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { holiday.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdUserId)) { holiday.UserId = reader.GetInt32(OrdUserId); }
	        	
	    	if (!reader.IsDBNull(OrdDate)) { holiday.Date = reader.GetDateTime(OrdDate); }
	        			
			holiday.IsNew = false;
			
			return holiday;
		}
	}
	
		
    public class DTOParserNews : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdTitle;
		
		public int OrdSummary;
		
		public int OrdContent;
		
		public int OrdCreatedDate;
		
		public int OrdUserId;
		
		public int OrdStatus;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdTitle = reader.GetOrdinal("Title");
	        	
	    	OrdSummary = reader.GetOrdinal("Summary");
	        	
	    	OrdContent = reader.GetOrdinal("Content");
	        	
	    	OrdCreatedDate = reader.GetOrdinal("CreatedDate");
	        	
	    	OrdUserId = reader.GetOrdinal("UserId");
	        	
	    	OrdStatus = reader.GetOrdinal("Status");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			NewsDto news = new NewsDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { news.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdTitle)) { news.Title = reader.GetString(OrdTitle); }
	        	
	    	if (!reader.IsDBNull(OrdSummary)) { news.Summary = reader.GetString(OrdSummary); }
	        	
	    	if (!reader.IsDBNull(OrdContent)) { news.Content = reader.GetString(OrdContent); }
	        	
	    	if (!reader.IsDBNull(OrdCreatedDate)) { news.CreatedDate = reader.GetDateTime(OrdCreatedDate); }
	        	
	    	if (!reader.IsDBNull(OrdUserId)) { news.UserId = reader.GetInt32(OrdUserId); }
	        	
	    	if (!reader.IsDBNull(OrdStatus)) { news.Status = reader.GetString(OrdStatus); }
	        			
			news.IsNew = false;
			
			return news;
		}
	}
	
		
    public class DTOParserNotice : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdTitle;
		
		public int OrdContent;
		
		public int OrdCreatedDate;
		
		public int OrdUserId;
		
		public int OrdStatus;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdTitle = reader.GetOrdinal("Title");
	        	
	    	OrdContent = reader.GetOrdinal("Content");
	        	
	    	OrdCreatedDate = reader.GetOrdinal("CreatedDate");
	        	
	    	OrdUserId = reader.GetOrdinal("UserId");
	        	
	    	OrdStatus = reader.GetOrdinal("Status");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			NoticeDto notice = new NoticeDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { notice.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdTitle)) { notice.Title = reader.GetString(OrdTitle); }
	        	
	    	if (!reader.IsDBNull(OrdContent)) { notice.Content = reader.GetString(OrdContent); }
	        	
	    	if (!reader.IsDBNull(OrdCreatedDate)) { notice.CreatedDate = reader.GetDateTime(OrdCreatedDate); }
	        	
	    	if (!reader.IsDBNull(OrdUserId)) { notice.UserId = reader.GetInt32(OrdUserId); }
	        	
	    	if (!reader.IsDBNull(OrdStatus)) { notice.Status = reader.GetString(OrdStatus); }
	        			
			notice.IsNew = false;
			
			return notice;
		}
	}
	
		
    public class DTOParserPermission : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdName;
		
		public int OrdDescription;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdName = reader.GetOrdinal("Name");
	        	
	    	OrdDescription = reader.GetOrdinal("Description");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			PermissionDto permission = new PermissionDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { permission.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdName)) { permission.Name = reader.GetString(OrdName); }
	        	
	    	if (!reader.IsDBNull(OrdDescription)) { permission.Description = reader.GetString(OrdDescription); }
	        			
			permission.IsNew = false;
			
			return permission;
		}
	}
	
		
    public class DTOParserShareFile : DTOParser
    {			
		
		public int OrdShareUserId;
		
		public int OrdFileId;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdShareUserId = reader.GetOrdinal("ShareUserId");
	        	
	    	OrdFileId = reader.GetOrdinal("FileId");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			ShareFileDto shareFile = new ShareFileDto();
			
				
	    	if (!reader.IsDBNull(OrdShareUserId)) { shareFile.ShareUserId = reader.GetInt32(OrdShareUserId); }
	        	
	    	if (!reader.IsDBNull(OrdFileId)) { shareFile.FileId = reader.GetInt32(OrdFileId); }
	        			
			shareFile.IsNew = false;
			
			return shareFile;
		}
	}
	
		
    public class DTOParserShareNotice : DTOParser
    {			
		
		public int OrdShareUserId;
		
		public int OrdNoticeId;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdShareUserId = reader.GetOrdinal("ShareUserId");
	        	
	    	OrdNoticeId = reader.GetOrdinal("NoticeId");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			ShareNoticeDto shareNotice = new ShareNoticeDto();
			
				
	    	if (!reader.IsDBNull(OrdShareUserId)) { shareNotice.ShareUserId = reader.GetInt32(OrdShareUserId); }
	        	
	    	if (!reader.IsDBNull(OrdNoticeId)) { shareNotice.NoticeId = reader.GetInt32(OrdNoticeId); }
	        			
			shareNotice.IsNew = false;
			
			return shareNotice;
		}
	}
	
		
    public class DTOParserTask : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdSubject;
		
		public int OrdDate;
		
		public int OrdUserId;
		
		public int OrdDescription;
		
		public int OrdCreatedDate;
		
		public int OrdStatus;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdSubject = reader.GetOrdinal("Subject");
	        	
	    	OrdDate = reader.GetOrdinal("Date");
	        	
	    	OrdUserId = reader.GetOrdinal("UserId");
	        	
	    	OrdDescription = reader.GetOrdinal("Description");
	        	
	    	OrdCreatedDate = reader.GetOrdinal("CreatedDate");
	        	
	    	OrdStatus = reader.GetOrdinal("Status");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			TaskDto task = new TaskDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { task.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdSubject)) { task.Subject = reader.GetString(OrdSubject); }
	        	
	    	if (!reader.IsDBNull(OrdDate)) { task.Date = reader.GetDateTime(OrdDate); }
	        	
	    	if (!reader.IsDBNull(OrdUserId)) { task.UserId = reader.GetInt32(OrdUserId); }
	        	
	    	if (!reader.IsDBNull(OrdDescription)) { task.Description = reader.GetString(OrdDescription); }
	        	
	    	if (!reader.IsDBNull(OrdCreatedDate)) { task.CreatedDate = reader.GetDateTime(OrdCreatedDate); }
	        	
	    	if (!reader.IsDBNull(OrdStatus)) { task.Status = reader.GetString(OrdStatus); }
	        			
			task.IsNew = false;
			
			return task;
		}
	}
	
		
    public class DTOParserUser : DTOParser
    {			
		
		public int OrdId;
		
		public int OrdEmail;
		
		public int OrdPassword;
		
		public int OrdPasswodSaltr;
		
		public int OrdFullName;
		
		public int OrdAddress;
		
		public int OrdPhone;
		
		public int OrdBirthDate;
		
		public int OrdDescription;
		
		public int OrdGroupUserId;
		
		public int OrdPermissionId;
		
		public int OrdCreatedDate;
		
		public int OrdStatus;
			
		public override void PopulateOrdinals(SqlDataReader reader)
		{
				
	    	OrdId = reader.GetOrdinal("Id");
	        	
	    	OrdEmail = reader.GetOrdinal("Email");
	        	
	    	OrdPassword = reader.GetOrdinal("Password");
	        	
	    	OrdPasswodSaltr = reader.GetOrdinal("PasswodSaltr");
	        	
	    	OrdFullName = reader.GetOrdinal("FullName");
	        	
	    	OrdAddress = reader.GetOrdinal("Address");
	        	
	    	OrdPhone = reader.GetOrdinal("Phone");
	        	
	    	OrdBirthDate = reader.GetOrdinal("BirthDate");
	        	
	    	OrdDescription = reader.GetOrdinal("Description");
	        	
	    	OrdGroupUserId = reader.GetOrdinal("GroupUserId");
	        	
	    	OrdPermissionId = reader.GetOrdinal("PermissionId");
	        	
	    	OrdCreatedDate = reader.GetOrdinal("CreatedDate");
	        	
	    	OrdStatus = reader.GetOrdinal("Status");
	        		}
		
		public override DTOBase PopulateDTO(SqlDataReader reader)
	    {
					
			UserDto user = new UserDto();
			
				
	    	if (!reader.IsDBNull(OrdId)) { user.Id = reader.GetInt32(OrdId); }
	        	
	    	if (!reader.IsDBNull(OrdEmail)) { user.Email = reader.GetString(OrdEmail); }
	        	
	    	if (!reader.IsDBNull(OrdPassword)) { user.Password = reader.GetString(OrdPassword); }
	        	
	    	if (!reader.IsDBNull(OrdPasswodSaltr)) { user.PasswodSaltr = reader.GetString(OrdPasswodSaltr); }
	        	
	    	if (!reader.IsDBNull(OrdFullName)) { user.FullName = reader.GetString(OrdFullName); }
	        	
	    	if (!reader.IsDBNull(OrdAddress)) { user.Address = reader.GetString(OrdAddress); }
	        	
	    	if (!reader.IsDBNull(OrdPhone)) { user.Phone = reader.GetString(OrdPhone); }
	        	
	    	if (!reader.IsDBNull(OrdBirthDate)) { user.BirthDate = reader.GetDateTime(OrdBirthDate); }
	        	
	    	if (!reader.IsDBNull(OrdDescription)) { user.Description = reader.GetString(OrdDescription); }
	        	
	    	if (!reader.IsDBNull(OrdGroupUserId)) { user.GroupUserId = reader.GetInt32(OrdGroupUserId); }
	        	
	    	if (!reader.IsDBNull(OrdPermissionId)) { user.PermissionId = reader.GetInt32(OrdPermissionId); }
	        	
	    	if (!reader.IsDBNull(OrdCreatedDate)) { user.CreatedDate = reader.GetDateTime(OrdCreatedDate); }
	        	
	    	if (!reader.IsDBNull(OrdStatus)) { user.Status = reader.GetString(OrdStatus); }
	        			
			user.IsNew = false;
			
			return user;
		}
	}
	

}

